﻿using System;
using Sogeti.Guidelines.Examples;
using Sogeti.Guidelines.Examples.Service;
using Sogeti.Guidelines.WCF.Hosting;

namespace Sogeti.Guidelines.WCF.Consolehost
{
    internal class Program
    {
        private static void Main()
        {
            using (
                var host = new CommonServiceHost<AppContainer>(typeof (EchoService),
                                                               new Uri("http://localhost:8080/echo")))
            {
                host.Open();

                foreach (var se in host.Description.Endpoints)
                    Console.WriteLine("A: {0}, B: {1}, C: {2}",
                                      se.Address, se.Binding.Name, se.Contract.Name);

                Console.WriteLine("Press any key to stop the service.");
                Console.ReadKey();

                host.Close();
            }
        }
    }
}